<gm:page title="PicasaWeb留言" authenticate="false">

<script>
  var url=window.location.toString();
  var tmpUserID='';
  if(url.indexOf("?")!=-1){
    var ary=url.split("?")[1].split("&");
    for(var i in ary){
      if( ary[i].split("=")[0] == "UserID" ){
          tmpUserID = ary[i].split("=")[1] ;
      }
    }
  }
  if (tmpUserID!=''  ){
    google.mashups.getObjectById('myList').setData( "http://picasaweb.google.com/data/feed/api/user/" + tmpUserID + "/?kind=comment&access=public" + '|${annotations}');
  }

function getFeed() {
var url = "http://picasaweb.google.com/data/feed/api/user/" + document.getElementById('UserID').value + "/?kind=comment&access=public";
if (url) {
if (url.indexOf("http://") != 0) {
url = "http://" + url;
}
google.mashups.getObjectById('myList').setData(url + '|${annotations}');
}
}
</script>

<input type="text" id="UserID" value="請輸入要查看的Picasa ID" size="25"/>
<button onclick="getFeed()">查看留言</button>
<hr size="1">
      
<gm:list id="myList" template="myListTemplate" pagesize="5"/>

<gm:template id="myListTemplate">
<table class="blue-theme" width="240">
<thead>
  <tr>
    <td >    
    Picasa Web留言</td>
  </tr>
</thead>

  <tr repeat="true">
    <td>
    <string><gm:text ref="atom:author/atom:name"/></string>
    <p><gm:html ref="atom:content"/></p>
    <gm:date ref="atom:updated"/> <gm:link ref="atom:link[@rel='alternate']/@href" labelref="View" />
    </td>
  </tr>  
  
<tfoot>
  <tr>
    <td align="center"><gm:pager compact="true"/></td>
  </tr> 
</tfoot>
</table>
</gm:template>

<div id="ad">
  <p> </p>
<script type="text/javascript"><!--
google_ad_client = "pub-7230933256978094";
/* 234x60, 已建立 2008/6/25 googlemashups */
google_ad_slot = "4522152135";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>  
</div>

</gm:page>
